package cn.wolfcode.web.controller;

import cn.wolfcode.transfer.domain.Business;
import cn.wolfcode.transfer.domain.SystemDictionaryItem;
import cn.wolfcode.transfer.service.IAppointmentService;
import cn.wolfcode.transfer.service.IBusinessService;
import cn.wolfcode.transfer.service.ISystemDictionaryItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
public class IndexController {
    @Autowired
    private IBusinessService businessService;
    @Autowired
    private ISystemDictionaryItemService systemDictionaryItemService;

    @RequestMapping("/index")
    public String index(Model model) {
        Business business = businessService.selectmain();
        model.addAttribute("business", business);
        List<SystemDictionaryItem> list = systemDictionaryItemService.selectByTypeSN("business");
        model.addAttribute("List",list);
        List<Business> businesses = businessService.listAll();
        model.addAttribute("businesses",businesses);
        return "/index";
    }
}
